import allure

from base.base_page import BasePage
from locator.book_details_page_loc import *


class BookDetailsPage(BasePage):
    @allure.step("获取立即阅读按钮文本")
    def get_access_details_success_result(self):
        txt= self.get_text(read_book_btn_loc)
        return txt

    @allure.step("点击加入书架按钮")
    def click_add_bookshelf_btn(self):
        self.click(add_bookshelf_btn_loc)

    @allure.step("获取已在书架文本")
    def get_add_bookshelf_btn_text(self,txt):
        result = self.text_wait(add_bookshelf_btn_loc,txt)
        return result
